package ${package.Security};

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.layuiframework.stereotype.security.bean.AbstractUser;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class WebUser extends AbstractUser {

    private String name;
    private String password;
    private String roleid;
<#assign genericity = 'String' />
    private List<${genericity}> roleids = new ArrayList<>();

    @Override
    public String getSecurityUsername() {
        return this.name;
    }

    @Override
    public String getSecurityPassword() {
        return this.password;
    }

    @Override
    public List<${genericity}> getSecurityRole() {
        if(roleids.isEmpty()) roleids.add(roleid);
        return roleids;
    }
}
